export const DEFAULT_PAGE_PATH = '/home'

// 基本路由
export const BASE_ROUTES = [
  { path: '/login', component: () => import('@/views/login/LoginPage.vue') } // 登录页
]

// 用于左侧菜单渲染 可以设置meta 来控制显示 或实现你自定义的需求
export const LAYOUT_MENU = [
  {
    path: DEFAULT_PAGE_PATH,
    component: () => import('@/views/home/index.vue'),
    meta: {
      title: '首页',
      icon: 'homeFilled'
    }
  },
  {
    path: '/article/manage',
    component: () => import('@/views/article/ArticleManage.vue'),
    meta: {
      title: '分类管理',
      icon: 'list'
    }
  },
  {
    path: '/article/channel',
    component: () => import('@/views/article/ArticleChannel.vue'),
    meta: {
      title: '商品管理',
      icon: 'goods'
    }
  },
  {
    path: '/user/profile',
    component: () => import('@/views/user/UserProfile.vue'),
    meta: {
      title: '个人中心',
      icon: 'setting'
    }
  }
]
const routes = [
  ...BASE_ROUTES,
  {
    path: '/',
    component: () => import('@/views/layout/LayoutContainer.vue'),
    redirect: DEFAULT_PAGE_PATH,
    children: [
      ...LAYOUT_MENU,
      {
        path: '/user/avatar',
        component: () => import('@/views/user/UserAvatar.vue')
      },
      {
        path: '/user/password',
        component: () => import('@/views/user/UserPassword.vue')
      }
    ]
  }
]

export default routes
